#define _CRT_SECURE_NO_WARNINGS 1

#include <iostream>
#include <string>
using namespace std;

int main() {
    string s;
    cin >> s;
    for (int pos = 0; pos < (int)s.size() - 1; pos++) {
        if (s[pos] == s[pos + 1]) {
            s.erase(s.begin() + pos);
            s.erase(s.begin() + pos);
            pos = pos < 2 ? -1 : pos - 3;
        }
    }
    cout << s << endl;
}
